package cn.skyclass.business
{
	import mx.collections.ArrayCollection;
	
	[Bindable]
	public class BaseEnum
	{
		public function BaseEnum(value:int=0, name:String="")
		{
			this.value = value;
			this.name = name;
		}
		
		
		public var name:String;
		public var value:int;

		
		public function equals(value:int):Boolean{
			return this.value == value;
		}
		
		public function equalsName(name:String):Boolean{
			return this.name == name;
		}
		
		public static function getObject(value:int, list:ArrayCollection):BaseEnum{
			for each(var i:BaseEnum in list){
				if(i.equals(value)) return i;
			}
			return null;
		}
				
	}
}